<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人资料 - AI Chat</title>
    <style>
        /* 基础样式 */
        :root {
            --primary: #4361ee;
            --primary-dark: #3a56d4;
            --secondary: #3f37c9;
            --accent: #4895ef;
            --dark: #1d1e2c;
            --darker: #121420;
            --light: #f8f9fa;
            --gray: #6c757d;
            --light-gray: #a0aec0;
            --success: #4cc9f0;
            --warning: #f72585;
            --card-bg: rgba(255, 255, 255, 0.05);
            --border-radius: 12px;
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        body {
            background: linear-gradient(135deg, var(--darker), var(--dark));
            color: var(--light);
            min-height: 100vh;
            padding: 2rem;
        }

        /* 资料容器 */
        .profile-container {
            max-width: 800px;
            margin: 0 auto;
            background: var(--card-bg);
            border-radius: var(--border-radius);
            padding: 2.5rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .profile-header {
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .profile-title {
            color: var(--accent);
            font-size: 1.8rem;
        }

        /* 表单样式 */
        .form-section {
            margin-bottom: 2.5rem;
        }

        .section-title {
            color: var(--accent);
            font-size: 1.4rem;
            margin-bottom: 1.5rem;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
        }

        .form-group {
            margin-bottom: 1.25rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--light);
        }

        .form-control {
            width: 100%;
            padding: 0.75rem 1rem;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--border-radius);
            color: var(--light);
            font-size: 1rem;
            transition: var(--transition);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
        }

        /* 错误提示 */
        .errorlist {
            list-style: none;
            color: var(--warning);
            font-size: 0.85rem;
            margin-top: 0.5rem;
        }

        /* 按钮样式 */
        .btn-group {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
        }

        .btn {
            padding: 0.75rem 1.5rem;
            border-radius: var(--border-radius);
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
            border: none;
        }

        .btn-primary:hover {
            background: var(--secondary);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
        }

        /* 房间列表 */
        .room-list {
            list-style: none;
            padding: 0;
            margin-top: 1.5rem;
        }

        .room-item {
            padding: 1rem;
            background: rgba(255, 255, 255, 0.03);
            border-radius: var(--border-radius);
            margin-bottom: 0.75rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .room-name {
            font-weight: 500;
            color: var(--light);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            body {
                padding: 1rem;
            }

            .profile-container {
                padding: 1.5rem;
            }

            .profile-title {
                font-size: 1.5rem;
            }

            .btn-group {
                flex-direction: column;
            }

            .btn {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div class="profile-container">
        <div class="profile-header">
            <h1 class="profile-title">个人资料</h1>
        </div>

        <form method="POST">
            {% csrf_token %}

            <div class="form-section">
                <h2 class="section-title">基本信息</h2>
                <div class="form-grid">
                    {% for field in form %}
                        <div class="form-group">
                            <label>{{ field.label }}</label>
                            {{ field }}
                            {% if field.errors %}
                                <ul class="errorlist">
                                    {% for error in field.errors %}
                                        <li>{{ error }}</li>
                                    {% endfor %}
                                </ul>
                            {% endif %}
                        </div>
                    {% endfor %}
                </div>
            </div>

            <div class="btn-group">
                <button type="submit" class="btn btn-primary">保存更改</button>
                <a href="{% url 'Chat:room_list' %}" class="btn" style="border: 1px solid var(--primary); color: var(--primary);">返回首页</a>
            </div>
        </form>


    </div>
</body>
</html>